import java.util.ArrayList;
import java.util.List;

public class AbstractDemo05 {
    public static void main(String[] args) {
        Account account = new NormalCard();// 多态
        account.setName("小明的储蓄卡");

        List list = new ArrayList();

    }
}


abstract class Account {
    private String name;

    public Account() {
    }

    public Account(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    //抽象方法
    public abstract void withDraw();

    public void getInfo() {
        System.out.println("哈哈哈");
    }

}

// 储蓄卡类
class NormalCard extends Account {
    @Override
    public void withDraw() {
        System.out.println("从账户余额取钱");
    }
}

// 信用卡类
class CreditCard extends Account {
    @Override
    public void withDraw() {
        System.out.println("余额+额度取钱");
    }
}